<template>
	<view>
		<view class="titleBox">
			<view class="titleLeft">
				<img src="../../static/title/back.png" class="titleBack" @click="goBack">
			</view>
			<view class="titleText">
				<text>余额</text>
			</view>
			<view class="titleRight">
				
			</view>
		</view>
		<view class="box" v-for="item,index in list" :key="index">
			<view class="top">
				<view class="left">
					{{item.Kind}}
				</view>
				<view class="right">
					{{item.Money}}
				</view>
			</view>
			<view class="top">
				<view class="left2">
					{{item.CreateTime}}
				</view>
				<view class="right2">
					余额 {{item.CurBalance}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var app = getApp();
	export default {
		data() {
			return {
				title:'余额明细',
				list: [
					{
						Kind:'浏览访问',
						Money:'+0.01',
						CreateTime:'9月1日 09:18',
						CurBalance:0.01
					},
					{
						Kind:'提现',
						Money:'-100.00',
						CreateTime:'9月1日 09:18',
						CurBalance:100.00
					},
					{
						Kind:'开通会员',
						Money:'-99.00',
						CreateTime:'9月1日 09:18',
						CurBalance:0.00
					}
				]
			};
		},
		onLoad() {
			debugger;
			this.getBalanceDetail();
		},
		methods: {
			// 返回
			goBack() {
				uni.navigateBack(0)
			},
			getBalanceDetail(){
				console.log(111111);
				debugger;
				this.$myRequest({
					url: 'getBalanceDetail',
					data: {
							OpenID: app.globalData.openID
						},
					dataType: 'json',
				}).then(res => {
					debugger;
					console.log(res.data);
					this.list= res.data;
				})
			}
		}
	}
</script>

<style lang="scss">
.box {
	width: 90%;
	margin: 0 auto;
	border-bottom: 1rpx solid #ccc;
	.top {
		display: flex;
		justify-content: space-between;
		margin: 20rpx 0;
		color: #000;
		.left {
			font-size: 30rpx;
			color: #000;
		}
		.right {
			font-size: 35rpx;
			color: #e5b247;
		}
		.left2 {
			font-size: 24rpx;
			color: #a0a2b1;
		}
		.right2 {
			font-size: 24rpx;
			color: #a0a2b1;
		}
	}
}
</style>
